#ifndef __ASIO_THREAD_POOL__
#define __ASIO_THREAD_POOL__

#include <boost/asio.hpp>
#include <cstddef>
#include <thread>
#include <vector>
#include <memory>

class AsioThreadPool
{
public:
    using IOContext = boost::asio::io_context;
    using Work = boost::asio::io_context::work;
    using WrokPtr = std::unique_ptr<Work>;

	AsioThreadPool(std::size_t threadCount = std::thread::hardware_concurrency());
	~AsioThreadPool();

    IOContext& get_io_context();
    void stop();

private:
    IOContext _io_context;
    std::vector<std::thread> _threads;
    WrokPtr _work;
};


#endif // !__ASIO_THREAD_POOL__
